{extend name="public:_base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/uploadify/uploadify.css">
{/block}
{block name="js"}
{include file="public/_validform"}
<!--上传配置 -->
<script src="__STATIC__/admin/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/upfile.js" type="text/javascript"></script>
<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.all.js"></script>
<!--验证-->
<script type="text/javascript">
        var ue = UE.getEditor('editor');
        var ue = UE.getEditor('editor2',{
            toolbars: [
                ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
            ],
            initialFrameHeight:150,
        });

        $("[name='cid']").find("[value='{$data.cid ?? ''}']").attr("selected", true);
        upload_image('image','','200','200','500');
        var URL = {
                uploader: '{:url('Upload/image')}',
                swf:'__STATIC__/admin/uploadify/uploadify.swf',
                ROOT:'__ROOT__/uploads/image',
                del_url:'{:url('Product/delimage')}',
                }


</script>
{/block}
{block name="main"}

<article class="page-container">
    
    <form class="form form-horizontal" action="{:url('Product/save')}" id="form" method="post">
        
        <table class="table table-border table-bordered table-bg mt-20 table-style">
            <thead>
                <tr>
                    <th colspan="2" scope="col">填写信息</th>
                </tr>
            </thead>
            
            <tbody>
                <tr>
                    <th>
                        <span class="c-red">*</span>名称：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.title ?? ''}" placeholder="" name="title" datatype="*" nullmsg="请填写商品名称">
                    </td>
                </tr>
                
                <tr>
                    <th>
                        <span class="c-red">*</span>标题：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.seo_title ?? ''}" placeholder="" name="seo_title" datatype="*" nullmsg="请填写产品标题">
                    </td>
                </tr>
                
                <tr>
                    <th>
                        <span class="c-red">*</span>参数：
                    </th>
                    <td>
                        <script id="editor2" type="text/plain" name="parameter" style="width:100%;height:400px;">{$data.parameter|default=''|html_entity_decode ?? ''}</script>
                    </td>
                </tr>
                
                <!--
                <tr>
                    <th>
                        <span class="c-red">*</span>价格：
                    </th>
                    <td>
                        <input type="number" class="input-text" value="{$data.jiaqian ?? ''}" placeholder="" name="jiaqian" min="0.00" step="0.01">
                    </td>
                </tr>
                -->
                
                <tr>
                    <th>
                        图片：264*260：
                    </th>
                    <td>
                        <div id="image_s">
                            <img src="__ROOT__/uploads/{$data.image ?'image/md_'.$data.image: 'sm_nopic.jpg'}" width="200px" height="200px"/>
                        </div>
                        <input id="image_post" name="image" type="hidden" value="{$data.image ?? ''}"/>
                        <input name="old_image" type="hidden" value="{$data.image ?? ''}"/>
                        <input id="image" name="image_upload" type="file" multiple="true">
                    </td>
                </tr>
                
                <tr>
                    <th>
                        图片：264*260：
                    </th>
                    <td>
                        <div id="s_s">
                            {volist name="data.images|default=''" id="vo"}
                            <div style="width: 200px;height: 200px;float: left;">
                                <a href="__ROOT__/uploads/image/{$vo.image}" target="_blank" title="查看">
                                    <img style="position: absolute;" width="200px" height="200px" src="__ROOT__/uploads/image/md_{$vo.image}">
                                </a><input name="images[]" value="{$vo.image}" type="hidden">
                                <a style="position: absolute;" onclick="delfile(this,'{$vo.image}');" title="删除">
                                    <i class="Hui-iconfont" style="font-size: 28px;background: #fff;">&#xe6e2;</i>
                                </a>
                            </div>
                            {/volist}
                        </div>
                        <div class="clear"></div>
                        <input id="s" name="duo" type="file" multiple="true">
                    </td>
                </tr>
                
                <tr>
                    <th>
                        排序值：
                    </th>
                    <td>
                        <input type="number" class="input-text" value="{$data.stor ?? ''}" placeholder="" id="articlesort" name="stor">
                    </td>
                </tr>
                
                <tr>
                    <th>
                        <span class="c-red">*</span>关键词：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.key ?? ''}" placeholder="" id="keywords" name="key"  datatype="*" nullmsg="请填写关键词">
                    </td>
                </tr>
                
                <tr>
                    <th>
                        <span class="c-red">*</span>摘要：
                    </th>
                    <td>
                        <textarea name="miaoshu" class="textarea" placeholder="说点什么...最少输入10个字符" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！">{$data.miaoshu ?? ''}</textarea>
                    </td>
                </tr>
                
                <tr>
                    <th>
                        发布者：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.issue ?? ''}" placeholder="" id="author" name="issue">
                    </td>
                </tr>
                
                <tr>
                    <th>
                        <span class="c-red">*</span>内容：
                    </th>
                    <td>
                        <script id="editor" type="text/plain" name="center" style="width:100%;height:400px;">{$data.center|default=''|html_entity_decode ?? ''}</script>
                    </td>
                </tr>
            </tbody>
            
            <tfoot>
                <tr>
                    <th></th>
                    <td>
                        <input type="hidden"  value="{$data.id ?? ''}" name="id">
                        <input type="hidden" value="{$data.cid ?? $addcid}" name="cid">
                        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                        <button onClick="layer_close();" class="btn btn-default radius" type="button">
                            &nbsp;&nbsp;取消&nbsp;&nbsp;
                        </button>
                    </td>
                </tr>
            </tfoot>
        </table>
        
    </form>
    
</article>
{/block}

